#include <bits/stdc++.h>

#define ll long long
#define ull unsigned long long
#define uint unsigned int

#define YES cout << "Yes" << endl
#define NO cout << "No" << endl

const int INF = 1e9;
using namespace std;
/*思考
 *最优策略为删除首尾括号
 *如果删除首尾括号后，剩下的括号是平衡的，那么就返回No
 *如果删除首尾括号后，剩下的括号不是平衡的，那么就返回Yes
 */
bool isBalanced(string s) {
    int x = 0;
    for (char c : s) {
        if (c == '(') x++;
        else x--;
        if (x < 0) return false;
    }
    return x == 0;
}
void solve()
{
    string s;
    cin >> s;
    int n = s.length();

    string sub = s.substr(1, n - 2);

    if (isBalanced(sub)) NO;
    else YES;
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int t = 0;
    cin >> t;
    while (t--)
        solve();
    return 0;
}